$--key-width: 45px;
$--key-height: 300px;
$--top-height: 50px;

.music-main {
  // width: 100%;
  // height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.piano-wapper {
  width: 100%;
  height: calc(var(--scale) * 500px);
  padding-bottom: 50px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  border-radius: 6px;
  box-sizing: border-box;

  .piano {
    user-select: none;
  }
  @keyframes key-active-anim {
    0% {
      background-color: #fff;
    }

    80% {
      background-color: #999999;
    }

    100% {
      background-color: #bebebe;
    }
  }
  @keyframes keys-container-anim {
    0% {
      transform: translateY(50px) scale(0.95);
    }

    80% {
      transform: translateY(0px);
    }

    90% {
      transform: translateY(-5px);
    }

    100% {
      transform: translateY(0px);
    }
  }
  .key-wapper {
    cursor: pointer;
    width: $--key-width;
    height: $--key-height;

    .key {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      font-size: 18px;
      font-weight: 500;
      background-color: #f8f8f8;
      border: 1px solid #626161;
      border-bottom: 1px solid #adacac;
      // border-right: none;
      border-radius: 0 0 4px 4px;
      color: #222222;
      user-select: none;
      cursor: pointer;
      transition: all 0.1s ease-in-out;
      box-sizing: border-box;
      box-shadow: 0px 10px 3px rgb(97 90 90 / 50%);
      perspective: 20px;
      transform-style: preserve-3d;
      transform-origin: top center;

      .key1 {
        color: #555;
        font-weight: bold;
        margin-bottom: 10px;
      }

      .key2 {
        font-size: 0.8rem;
      }
    }
    .key-active {
      background-color: #bebebe;
      border-right: 1px solid #979797;
      transform: rotateX(-10deg) translateZ(-10px);
      position: relative;
      animation: key-active-anim 0.2s ease-in-out forwards;
      z-index: -1;
      // background-color: #bebebe;
      background: linear-gradient(to bottom, #fff, #bebebe);
      border: 0px solid #626161;
    }
  }

  .key-wapper:nth-child(36) {
    .key {
      border-right: 1px solid #626161;
      border-bottom: 1px solid #adacac;
    }
  }

  .block-key {
    cursor: pointer;
    top: $--top-height;
    position: absolute;
    left: calc(calc(var(--left) * $--key-width) - calc($--key-width * 0.333));
    width: calc($--key-width * 0.666);
    height: calc($--key-height * 0.58);

    box-sizing: border-box;
    // background: linear-gradient(to bottom, #303030, #2c2c2c);
    background: linear-gradient(-20deg, #282828, #000, #333);
    border-color: #222 #666 #111 #555;
    border-style: solid;
    border-width: 1px 3px 8px;
    border-radius: 0 0 5px 5px;
    user-select: none;
    transition: 0.2s all;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    color: white;
    .key1 {
      color: #b7b7b7;
      font-weight: bold;
      margin-bottom: 10px;
    }
    .key2 {
      font-size: 0.8rem;
      color: #f3f3f3;
    }
  }

  .block-key-active {
    border-width: 1px 2px 5px;
    background: linear-gradient(-20deg, #0e0e0e, #000, #2b2b2b);
  }

  .block-key:active {
    border-width: 1px 2px 5px;
  }
}
@property --rotate {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.keys-container {
  width: calc($--key-width * 36);
  justify-content: center;
  perspective: 10000px;
  // z-index: -1;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  position: relative;
  animation: keys-container-anim 1s ease-in-out;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;

  .top-mask {
    position: absolute;
    top: 0;
    left: 0;
    height: $--top-height;
    box-sizing: border-box;
    width: 100%;
    border-top: 3px solid #555555;
    border-left: 1px solid #555555;
    border-right: 1px solid #555555;
    border-bottom: 2px solid #555555;
    background-color: black;

    .logo {
      --rotate: 90deg;
      background: linear-gradient(
        var(--rotate),
        #2c2b2b,
        #f8e8e8,
        rgb(105, 29, 29)
      );
      color: transparent;
      background-clip: text;
      width: fit-content;
      margin-left: 20px;
      height: 100%;
      align-content: center;
      font-family: HFSantaMonica-2;
      font-size: 2rem;
      // color: rgb(204, 202, 202);
      // text-shadow: 1px -1px #9c1414, -1px 1px #d8b6b6,
      //   -5px 5px 3px rgba(128, 128, 128, 0.5019607843);
    }
  }
}

.song-list {
  margin-top: 20px;
  width: 80vw;

  .song-item {
    min-height: 70px;
    background-color: white;
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    gap: 20px;
    position: relative;
    margin-bottom: 10px;
    box-sizing: border-box;

    .buttons {
      margin: 5px 0;
      flex: 1;
      overflow: hidden;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: right;
      flex-wrap: wrap;
      gap: 10px;
    }
    .song-name {
      font-size: 16px;
      font-weight: 500;

      input {
        border: 1px solid #ccc;
        outline: none;
        padding: 5px;
        border-radius: 5px;
        width: 100%;
      }
    }

    .song-time {
      font-size: 14px;
      color: #666;
    }

    .song-play {
      cursor: pointer;
      user-select: none;
      padding: 5px 10px;
      border-radius: 5px;

      .inner {
        margin: 4px 0;
        width: 15px;
        height: 15px;
      }
    }

    .song-stop {
      cursor: pointer;
      user-select: none;
      background-color: #000;
      padding: 5px 10px;
      border-radius: 5px;
      color: white;

      .inner {
        margin: 4px 0;
        width: 15px;
        height: 15px;
        border-radius: 2px;
        background-color: white;
      }
    }

    .song-remove {
      cursor: pointer;
      user-select: none;
      color: var(--ui-text-2);
      padding: 5px 10px;
      border-radius: 5px;
      transition: 0.3s;
      opacity: 0;
    }
  }

  .song-item:hover {
    .song-remove {
      opacity: 1;
    }
  }

  .song-item-active {
    border: 1px solid #d8d8d88e;
    animation: song-iten-active-anim 5s ease-in-out infinite;
  }

  @keyframes song-iten-active-anim {
    0% {
      transform: translateY(0px);
    }

    92% {
      transform: translateY(0px);
    }

    97% {
      transform: translateY(-5px);
    }

    100% {
      transform: translateY(0px);
    }
  }
}

@media screen and (max-width: 768px) {
  .song-list {
    width: 100%;

    .song-item {
      .song-remove {
        opacity: 1;
      }
    }
  }
}

.function-btn {
  cursor: pointer;
  user-select: none;
  color: var(--ui-text);
  background-color: var(--ui-backgound);
  padding: 10px 20px;
  border-radius: 5px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;

  .logo {
    display: inline;
    margin: 4px 0;
    width: 15px;
    height: 15px;
  }

  .stop {
    background-color: white;
    width: 15px;
    height: 15px;
    border-radius: 2px;
    margin: 4px 0;
  }
}
